
#include "screen.d2"

border_color = black
background_color = black
call clear_screen()

def title[] = "(C)2014 DRONTSOFT PRODUCTIONS."
def tmp:byte
def x:byte
def x2:byte
def lastx:byte

def color:byte = 7
def delay:byte = 3

x = 5
for i:0..title[] {
	tmp = title[i]
	if(tmp > 0) {
		screen[x, 11] = tmp
	}

	call change_color()
	text_color[x, 11] = color
	inc x
}

lastx = x

while(forever) {
	call wait_raster(254)

	// Move color
	x = 5
	x2 = 6
	for i:0..title[] {
		tmp = text_color[x2, 11]
		text_color[x, 11] = tmp
		inc x
		inc x2
	}

	call change_color()
	text_color[lastx, 11] = color
}

sub change_color() {
	inc delay
	if(delay > 3) {
		inc color
		if(color = 10) {
			color = 7
		}
		delay = 0
	}
}